package com.example.demo.base.thread;

/**
 * @program: demo
 * @description: 测试Thread
 * @author: zhouhongtao
 * @happyCreateTime: 2021/10/26 12:06
 */
public class HelloThread {


    public static void main(String[] args) {

        Thread t1 = new Thread("t1");

        ThreadGroup threadGroup = new ThreadGroup("test_group");

        Thread t2 = new Thread(threadGroup, "t2");

        System.out.println(t1.getThreadGroup());
        System.out.println(t2.getThreadGroup());

        System.out.println( t1.getThreadGroup() == t2.getThreadGroup());

    }


    private static void prtn(){
//        for (int i = 0; i < 100; i++) {
//            System.out.println(i);
//        }
        ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
        System.out.println("prtn:"+threadGroup);
    }


}
